#include "IObject.h"

IObject::IObject(IMesh* Mesh, IShader* Shader,PhysicObject* phy)
{
	assert(Mesh);
	assert(Shader);
	assert(phy);

	phyObje = phy;
	mesh = Mesh;
	shader = Shader;	
	obj.IOBJECT = this;
}

IObject::~IObject(void)
{
}

void IObject::Draw(DWORD elapsedTime,Camera* camera)
{	
	shader->SetShaderOnDevice(obj);
	mesh->SetMeshOnDevice();
	mesh->DrawMesh();
	shader->UnsetShaderOnDevice(obj);
}


void IObject::Update(DWORD elapsedTime,Camera* camera)
{
	mesh->Update(elapsedTime);
	shader->Update(obj,camera);	
}